package org.come.Jpanel;

import org.come.until.GsonUtil;
import com.tool.tcpimg.InputBean;
import java.math.BigDecimal;
import java.awt.image.ImageObserver;
import org.come.Frame.TestSetupJframe;
import java.awt.Graphics;
import java.awt.Component;
import java.awt.event.MouseListener;
import org.come.mouslisten.SystemMouslisten;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class SwitchchannelsJpanel extends JPanel
{
    private JLabel dangqian;
    private JLabel bangp;
    private JLabel zhandou;
    private JLabel danmu;
    private JLabel duiwu;
    private JLabel xinxi;
    private JLabel shijie;
    private ImageIcon iconS;
    private ImageIcon iconH;
    private ImageIcon iconD;

    public SwitchchannelsJpanel() {
        this.iconH = new ImageIcon("inkImg/old/background/ss511.png");
        this.setPreferredSize(new Dimension(230, 280));
        this.setLayout(null);
        this.setOpaque(false);
        (this.dangqian = new JLabel()).setBounds(264, 51, 13, 12);
        this.dangqian.addMouseListener(new SystemMouslisten(116));
        this.add((Component)this.dangqian);
        (this.bangp = new JLabel()).setBounds(264, 51, 13, 12);
        this.bangp.addMouseListener(new SystemMouslisten(117));
        this.add((Component)this.bangp);
        (this.zhandou = new JLabel()).setBounds(264, 51, 13, 12);
        this.zhandou.addMouseListener(new SystemMouslisten(118));
        this.add((Component)this.zhandou);
        (this.danmu = new JLabel()).setBounds(264, 51, 13, 12);
        this.danmu.addMouseListener(new SystemMouslisten(119));
        this.add((Component)this.danmu);
        (this.duiwu = new JLabel()).setBounds(264, 51, 13, 12);
        this.duiwu.addMouseListener(new SystemMouslisten(120));
        this.add((Component)this.duiwu);
        (this.xinxi = new JLabel()).setBounds(264, 51, 13, 12);
        this.xinxi.addMouseListener(new SystemMouslisten(121));
        this.add((Component)this.xinxi);
        (this.shijie = new JLabel()).setBounds(264, 51, 13, 12);
        this.shijie.addMouseListener(new SystemMouslisten(122));
        this.add((Component)this.shijie);
    }

    @Override
    protected void paintComponent(final Graphics g) {
        super.paintComponent(g);
        g.drawImage(this.iconH.getImage(), 0, 0, 228, 280, (ImageObserver)this);

        this.dangqian.setBounds(72, 45, 15, 15);
        this.bangp.setBounds(72, 75, 15, 15);
        this.zhandou.setBounds(72, 105, 15, 15);
        this.danmu.setBounds(72, 135, 15, 15);
        this.duiwu.setBounds(183, 45, 15, 15);
        this.xinxi.setBounds(183, 75, 15, 15);
        this.shijie.setBounds(183, 105, 15, 15);
    }

    public static void addtext(final int type, final String text, final BigDecimal id, final String name) {
        final StringBuffer buffer = new StringBuffer();
        final InputBean[] inputBean = { null };
        if (type == 4) {
            if (id != null) {
                (inputBean[0] = new InputBean()).setType(1);
                inputBean[0].setId(id);
                inputBean[0].setName("[" + name + "]");
                inputBean[0].setColor("cFFFF00");
                buffer.append("#V");
                buffer.append(GsonUtil.getGsonUtil().getgson().toJson(inputBean[0]));
                buffer.append("#L#W");
            }
            buffer.append(text);
            GameJpanel.getGameJpanel().addNotice(buffer.toString());
        }
        else {
            if (type == 7) {
                GameJpanel.getGameJpanel().addBox("#T" + text, 8, null);
            }
            if (type == 0) {
                buffer.append("#Q");
            }
            else {
                if (type == 1) {
                    buffer.append("#D");
                }
                else {
                    if (type == 2) {
                        buffer.append("#P");
                    }
                    else {
                        if (type == 3) {
                            buffer.append("#J");
                        }
                        else {
                            if (type != 5 && type != 7) {
                                if (type == 6) {
                                    buffer.append("#X");
                                }
                            }
                            else {
                                buffer.append("#T");
                            }
                        }
                    }
                }
            }
            if (type != 5 && type != 6 && type != 7) {
                if (id != null) {
                    (inputBean[0] = new InputBean()).setType(1);
                    inputBean[0].setId(id);
                    inputBean[0].setName("[" + name + "]");
                    inputBean[0].setColor("G");
                    buffer.append("#V");
                    buffer.append(GsonUtil.getGsonUtil().getgson().toJson(inputBean[0]));
                    buffer.append("#L");
                }
                else {
                    if (name != null) {
                        buffer.append("[" + name + "]");
                    }
                }
                buffer.append(text);
            }
            else {
                buffer.append("#Y");
                buffer.append(text);
            }
        }
    }

    public JLabel getDangqian() {
        return this.dangqian;
    }

    public void setDangqian(final JLabel dangqian) {
        this.dangqian = dangqian;
    }

    public JLabel getBangp() {
        return this.bangp;
    }

    public void setBangp(final JLabel bangp) {
        this.bangp = bangp;
    }

    public JLabel getZhandou() {
        return this.zhandou;
    }

    public void setZhandou(final JLabel zhandou) {
        this.zhandou = zhandou;
    }

    public JLabel getDanmu() {
        return this.danmu;
    }

    public void setDanmu(final JLabel danmu) {
        this.danmu = danmu;
    }

    public JLabel getDuiwu() {
        return this.duiwu;
    }

    public void setDuiwu(final JLabel duiwu) {
        this.duiwu = duiwu;
    }

    public JLabel getXinxi() {
        return this.xinxi;
    }

    public void setXinxi(final JLabel xinxi) {
        this.xinxi = xinxi;
    }

    public JLabel getShijie() {
        return this.shijie;
    }

    public void setShijie(final JLabel shijie) {
        this.shijie = shijie;
    }

    public ImageIcon getIconS() {
        return this.iconS;
    }

    public void setIconS(final ImageIcon iconS) {
        this.iconS = iconS;
    }

    public ImageIcon getIconH() {
        return this.iconH;
    }

    public void setIconH(final ImageIcon iconH) {
        this.iconH = iconH;
    }

    public ImageIcon getIconD() {
        return this.iconD;
    }

    public void setIconD(final ImageIcon iconD) {
        this.iconD = iconD;
    }
}
